Image processing apparatus and program recording medium

ABSTRACT

The image processing apparatus according to the present invention includes a local skin color level calculating section, a local brightness deviation calculating section, and a correction amount calculating section. The local skin color level calculating section calculates, as a local skin color level, a skin color level in a predetermined local region in an image. The local brightness deviation calculating section calculates, as a local brightness deviation, a brightness dynamic range in the predetermined local region. The correction amount calculating section determines whether the predetermined local region is a skin region or not by using the local skin color level and the local brightness deviation.

TECHNICAL FIELD

The present invention relates to an image processing apparatus and aprogram recording medium that can correct a digitalized image, and isapplicable to, for example, an image processing apparatus and a programrecording medium that can perform an image process in which a effect ofa correction is changed between a skin region and other region otherthan the skin contained in an image.

BACKGROUND ART

In a conventional image processing apparatus, a correcting processsimilar to that for the other region has been executed to a skin regionin an image. Therefore, an adverse affect from the viewpoint of imagequality is given to the skin portion of a person in the image. Forexample, when a correction for emphasizing an outline is executed as animage process, defect such as spots, wrinkles, breakouts, or the like ona face in the image becomes noticeable. Further, when a backlightprocess is executed as an image process, the face in the image becomesbrighter or darker, which appears odd compared to the other portions. Aregion of a skin of a person in an image is referred to as a “skinregion” hereinbelow.

There is Patent Document 1 or Patent Document 2 as a conventionaltechnique for solving the aforesaid problem. In the techniques disclosedin these documents, a skin region in an image is detected, wherein anamount of correction is reduced to the skin region. Thus, an adverseaffect from the viewpoint of image quality to the skin region issuppressed.

Specifically, in the technique disclosed in the Patent Document 1, whendetecting the skin region, an image is represented by a brightness andcolor difference, and a skin color level is obtained by using the colordifference so as to specify the region having the high skin color levelas a skin region. The image is represented by Y (brightness), Cb (colordifference), and Cr (color difference), wherein the difference betweenCb and Cr, which are central in a skin color, is employed as a skincolor level. In the technique disclosed in the Patent Document 2, animage is represented by Y, H, and C, wherein a skin region is specifiedby using H (color phase), and C (color saturation).

-   Patent Document 1: Japanese Patent Application Laid-Open No.    2005-341527-   Patent Document 2: Japanese Patent Application Laid-Open No.    2004-173328

DISCLOSURE OF THE INVENTION Problem that the Invention is to Solve

However, in the techniques disclosed in the Patent Documents 1 and 2, arate of erroneous determination upon detecting a skin region isincreased. Even if it is determined to be a skin color, it may be aregion other than a skin in most cases, so that there arises a subjectto enhance precision in the detection relating to the difference intexture between a skin and a portion other than the skin.

Moreover, a difference in a process-switching level might be noticeablein a gradation part or the like, only by the determination as to whetherit is a skin region or a region other than the skin.

In view of this, the present invention aims to provide an imageprocessing apparatus and a program recording medium that can enhanceprecision in determining a skin region, and that can reduce a differencein a process-switching level at a gradation part.

Means for Solving the Problem

In order to attain the foregoing object, an image processing apparatusaccording to claim 1 of the present invention includes a local skincolor level calculating section for calculating, as a local skin colorlevel, a skin color level at a predetermined local region in an image; alocal brightness deviation calculating section for calculating, as alocal brightness deviation, a brightness dynamic range at thepredetermined local region; and a skin region detecting section fordetecting whether the predetermined local region is a skin region or notby using the local skin color level and the local brightness deviation.

Further, an image processing apparatus according to claim 7 of thepresent invention includes a local skin color level calculating sectionfor calculating, as a local skin color level, a skin color level at apredetermined local region in an image; a local brightness highfrequency calculating section that, when a first brightness amplitudechange occurs in a first direction in the local region, and a secondbrightness amplitude change, which is smaller than the first brightnessamplitude change, occurs in a second direction, which is generallyorthogonal to the first direction, calculates a directionalhigh-frequency component, which is an index indicating a magnitude ofthe first brightness amplitude change to the amount of the secondbrightness amplitude change; and a skin region detecting section fordetecting whether the predetermined local region is a skin region or notby using the local skin color level and the directional high-frequencycomponent.

Further, a program recording medium according to claim 18 of the presentinvention records a program onto a computer-readable recording medium,the program including a step of calculating, as a local skin colorlevel, a skin color level at a predetermined local region in an image; astep of calculating, as a local brightness deviation, a brightnessdynamic range at the predetermined local region; and a step of detectingwhether the predetermined local region is a skin region or not by usingthe local skin color level and the local brightness deviation.

Further, a program recording medium according to claim 19 of the presentinvention records a program onto a computer-readable recording medium,the program including a step of calculating, as a local skin colorlevel, a skin color level at a predetermined local region in an image; astep of calculating a directional high-frequency component, which is anindex indicating a magnitude of a first brightness amplitude change toan amount of a second brightness amplitude change, when the firstbrightness amplitude change occurs in a first direction in thepredetermined local region, and the second brightness amplitude change,which is smaller than the first brightness amplitude change, occurs in asecond direction, which is generally orthogonal to the first direction;and a step of detecting whether the predetermined local region is a skinregion or not by using the local skin color level and the directionalhigh-frequency component.

EFFECT OF THE INVENTION

The image processing apparatus and the program recording mediumaccording to claim 1 and claim 18 of the present invention calculate thelocal skin color level and the local brightness deviation, and detectthe skin region based on the local skin color level and the localbrightness deviation.

Accordingly, the erroneous determination upon detecting the skin regioncan be reduced. In particular, since the skin region is detected by alsousing the local brightness deviation (brightness dynamic range) at thelocal region, the portion around the eye can be excluded from the skinregion, whereby the invention provides an effect of preventing theerroneous application of a skin texture and color correction to eyes oreyelashes.

The image processing apparatus and the program recording mediumaccording to claim 7 and claim 19 of the present invention calculate thelocal skin color level and the directional high-frequency component, anddetect the skin region based on the local skin color level and thedirectional high-frequency component.

Therefore, the invention provides an effect of reducing an erroneousdetermination upon detecting the skin region. In particular, since theskin region is detected by using also the directional high-frequencycomponent, hairs or the like can be excluded from the skin region,whereby the erroneous application of the skin texture and colorcorrection to hairs or the like can be prevented.

The object, feature, aspect, and advantage of the present invention willbe more apparent from the detailed description below and the appendeddrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a configuration of an imageprocessing apparatus according to the present invention.

FIG. 2 is a view for explaining a method of calculating a directionalhigh-frequency component.

FIG. 3 is a view illustrating a flow of an operation of the imageprocessing apparatus according to the present invention.

FIG. 4 is a view illustrating one example of a mapping curve.

FIG. 5 is a view for explaining an effect of a correction.

FIG. 6 is a view for explaining an effect of a correction.

BEST MODE FOR CARRYING OUT THE INVENTION

The present invention will specifically be described with reference tothe drawings illustrating the embodiment.

FIG. 1 is a block diagram illustrating the configuration of an imageprocessing apparatus 1 according to the embodiment of the presentinvention.

As illustrated in FIG. 1, the image processing apparatus 1 includes alocal average brightness calculating section 2, a local brightnessdeviation calculating section 3, a local brightness high frequencycalculating section 4, a local skin color level calculating section 5, acorrection amount (effect) calculating section 6, an image conversionprocessing section 7, a brightness signal delay section 8, and acolor-difference signal delay section 9.

Among video signals inputted to the image processing apparatus 1, abrightness signal (Y) is inputted to the local average brightnesscalculating section 2, the local brightness deviation calculatingsection 3, the local brightness high frequency calculating section 4,the local skin color level calculating section 5, and the brightnesssignal delay section 8. Further, a color-difference signal (C) among thevideo signals is inputted to the local skin color level calculatingsection 5 and the color-difference signal delay section 9.

The average brightness at the local region (local average brightnessvalue) is calculated at the local average brightness calculating section2, and the calculated local average brightness value is outputted to theimage conversion processing section 7.

The local region can include a predetermined-pixel-number region arounda target pixel. Alternatively, a screen (image) is divided into aplurality of blocks having a predetermined size, and the blockcontaining the target pixel may be used as the local region. Further,not only one block but also a plurality of blocks may be specified asthe local region, when the screen (image) is divided into a plurality ofblocks (for example, the later-described local brightness deviation maybe calculated in a unit of the block).

When some value (representative value) is obtained in the local region(hereinafter referred to as “to-be-local-region”), an average valueobtained from the value of each pixel including the local region, aweighed average value obtained while performing a predeterminedweighing, a central value, or a value obtained in complex with thesevalues is used.

At the local brightness deviation calculating section 3, theabove-mentioned brightness dynamic range at the local region iscalculated as the local brightness deviation, and the calculated localbrightness deviation is outputted to the correction amount (effect)calculating section 6.

For example, when the predetermined local region includes a plurality ofpixels, the maximum brightness value and the minimum brightness value ofthe brightness values of the pixels contained in the predetermined localregion are obtained. Then, the difference between the maximum brightnessvalue and the minimum brightness value is calculated (the result of thecalculation is the brightness dynamic range at the predetermined localregion).

For example, when the brightness dynamic range at the local region iscalculated, the local brightness deviation calculating section 3 furtherdivides the local region, which is the subject for the calculation, intoa plurality of small regions (for example, two pixels are consideredhere) smaller than the local region, and the two-pixel averagebrightness value is obtained beforehand for each of the small regions,in order to reduce the affect of noise. Among the obtained two-pixelaverage brightness values of the respective small regions in the localregion, the maximum two-pixel average brightness value and the minimumtwo-pixel average brightness value are obtained. Then, the differencebetween the maximum two-pixel average brightness value and the minimumtwo-pixel average brightness value may be calculated as the brightnessdynamic range.

The reason why the affect of noise can be reduced according to themethod described above is because, even if a great random noise isaccidentally added to the maximum brightness value (or the minimumbrightness value), the affect thereof can be reduced by obtaining theaverage of two pixels, for example.

At the local brightness high frequency calculating section 4, thedirectional high-frequency component, which becomes higher when aspatial high-frequency component in the local region has a spatialdirectionality, is obtained, and the obtained directional high-frequencycomponent is outputted to the correction amount (effect) calculatingsection 6.

In other words, when a first brightness amplitude change occurs in afirst direction in the predetermined local region, and a secondbrightness amplitude change, which is smaller than the first brightnessamplitude change, occurs in a second direction generally orthogonal tothe first direction, the local brightness high frequency calculatingsection 4 calculates the directional high-frequency component in thepredetermined local region as an index indicating the magnitude of thefirst brightness amplitude change to the second brightness amplitudechange. The first brightness amplitude change here means the maximumbrightness amplitude change when the brightness amplitude changes in alldirections of an image are obtained.

In the case described above, the directional high-frequency componentcan be specified as, for example, |the first brightness amplitudechange|−|the second brightness amplitude change|.

For example, when the brightness value Yij (0≦i≦2, 0≦j≦2) of each pixelincluding a rectangular region of 3-pixel×3-pixel illustrated in FIG. 2is used, (when FIR filter (3-tap FIR filter having coefficients of −0.5,1, −0.5) of continuous three pixels is used for determining frequenciesin four directions, that is, in the longitudinal direction, in thelateral direction, and in the diagonal directions (±45 degrees)), thedirectional high-frequency component h is expressed by the followingequation.

h=max(||Y11−(Y01+Y21)/2|−|Y11−(Y10+Y12)/2||,||Y11−(Y00+Y22)/2|−|Y11−(Y02+Y20)/2||)  (1)

At the local skin color level calculating section 5, the average skincolor level in the local region, for example, is calculated, and thecalculated average skin color level (hereinafter referred to as localskin color level) is outputted to the correction amount (effect)calculating section 6.

The skin color level here is a value obtained from the color-differencesignal Cb and the color-difference signal Cr (or the color-differencesignals Cb and Cr and the brightness signal Y). The skin color level isan index indicating a so-called skin color similarity, wherein it has ahigh value in the case of a skin color, while it has a low value in thecase of the portion other than the skin color.

For example, when the skin color level (local skin color level) is to beobtained in the local region, the average value obtained from the skincolor level of each pixel (or every two pixels, or every four pixels of2×2) including the local region, or the weighed average (weighedaverage) to which a predetermined weighing (for example, the weighing inwhich the weight increases at the center of the target block) is added,and the thus obtained value can be specified as the local skin colorlevel.

The correction amount (effect) calculating section 6 detects whether thepredetermined local region is a skin color region or not by using thelocal skin color level and the local brightness deviation.Alternatively, it detects whether the predetermined local region is askin color region or not by using the local skin color level and thedirectional high-frequency component. Alternatively, it detects whetherthe predetermined local region is a skin color region or not by usingthe local skin color level, the local brightness deviation, and thedirectional high-frequency component.

Specifically, the correction amount (effect) calculating section 6detects, as the skin region, the region where the local skin color levelis higher than a first threshold value and the local brightnessdeviation is smaller than a second threshold value. Alternatively, itdetects, as the skin region, the region where the local skin color levelis higher than the first threshold value and the directionalhigh-frequency component is smaller than the other threshold values.Alternatively, it detects, as the skin region, the region where thelocal skin color level is higher than the first threshold value, thelocal brightness deviation is smaller than the second threshold value,and the directional high-frequency component is smaller than the otherthreshold values.

In the case other than the above-mentioned case, it is determined thatthe local region is not the region (non-skin region). Each of thethreshold values by which the discrimination between the skin region andthe non-skin region is possible is empirically determined from aplurality of sample images.

The correction amount (effect) calculating section 6 obtains acorrection amount for an image process (or, in a case where thecorrection effect is changed between a case in which the local skincolor level is high and a case in which it is low, a correction indexfor changing the correction effect) that is continuously changedaccording to the local brightness deviation outputted from the localbrightness deviation calculating section 3 (and/or the directionalhigh-frequency component outputted from the local brightness highfrequency calculating section 4) and the local skin color leveloutputted from the local skin color level calculating section 5, andoutputs the resultant to the image conversion processing section 7.

For example, as the local skin color level is high, a correctionparameter b is increased, while as the local brightness deviation ishigh, the correction parameter b is decreased, and as the directionalhigh-frequency component is great, the correction parameter b isdecreased.

When the local brightness deviation is defined as d (0≦d≦255), thedirectional high-frequency component is defined as h (0≦h≦255), and thelocal skin color level is defined as s (−32≦s≦32), the correction index(correction parameter) b (−32≦b≦32) can also be represented as describedbelow.

When s>0 and d≧32, sd=s/4. When s>0 and 8≦d<32, sd=s (40−d)/32. In thecases other than the above-mentioned cases, sd=s. When s>0 and h≧8,sh=s/4. When s>0 and 2≦h<8, sh=s(10−h)/8. In the cases other than theabove-mentioned cases, sh=s. Further, b=min(sd, sh).

The above-mentioned sd continuously changes with respect to therespective changes of the local skin color level s and the localbrightness deviation d. The above-mentioned sh continuously changes withrespect to the respective changes of the local skin color level s andthe directional high-frequency component h. Accordingly, theabove-mentioned sd, sh, and the correction parameter b continuouslychanges.

The brightness signal delay section 8 delays the brightness signal (Y)among the video signals inputted to the image processing apparatus 1 bythe amount corresponding to the delay amount at the local averagebrightness calculating section 2 or the amount corresponding to thedelay amount at the local skin color level calculating section 5 and thecorrection amount (effect) calculating section 6, and outputs thedelayed signal to the image conversion processing section 7.

The image conversion processing section 7 determines the correctionamount (or the correction effect and the correction amount) for theimage process based on the local average brightness value inputted fromthe local average brightness calculating section 2 and the correctionamount (or the index for changing the correction effect) inputted fromthe correction amount (effect) calculating section 6. Then, the imageconversion processing section 7 performs the image process to thebrightness signal (Y), which is delayed at the brightness signal delaysection 8, based on the determined correction amount or the like. It isto be noted that the brightness signal (Y) that has been subject to theimage process (that has been corrected) is outputted from the imageprocessing apparatus 1.

As described later, the image conversion processing section 7continuously corrects an image with respect to the change in the localskin color level and the change in the local brightness deviation.Alternatively, the image conversion processing section 7 continuouslycorrects the image with respect to the change in the local skin colorlevel and the change in the directional high-frequency component.Alternatively, the image conversion processing section 7 continuouslycorrects the image with respect to the change in the local skin colorlevel, the change in the directional high-frequency component, and thechange in the directional high-frequency component.

The color-difference signal delay section 9 delays the color-differencesignal (C) among the video signals inputted into the image processingapparatus 1 in order to align the brightness signal (Y), which has beensubject to the image process, outputted from the image conversionprocessing section 7, and the phase. It is to be noted that the delayedcolor-difference signal (C) is outputted from the image processingapparatus 1.

FIG. 3 illustrates the operation according to the embodiment of thepresent invention in the form of a flowchart. Specifically, the localskin color level, the local brightness deviation, the directionalhigh-frequency component, and the local average brightness, in thepredetermined local region, are calculated at the local averagebrightness calculating section 2, the local brightness deviationcalculating section 3, the local brightness high frequency calculatingsection 4, and the local skin color level calculating section 5,illustrated in FIG. 1 (step S1). Next, at the correction amount (effect)calculating section 6, it is determined whether the local region is theskin region or the non-skin region by using the local skin color level,the local brightness deviation, and the directional high-frequencycomponent, and the correction parameter b is calculated (step S2).

Then, at the image conversion processing section 7, the correctingprocess is performed to the brightness signal by using the correctionparameter b (image conversion: step S3). Here, since the correctionparameter b is obtained from the local skin color level, the localbrightness deviation, and the directional high-frequency component, theimage conversion processing section 7 performs the correction of theimage to the brightness signal based on the local skin color level, thelocal brightness deviation, and the directional high-frequencycomponent. Alternatively, the image conversion processing section 7performs to the brightness signal by using the correction parameter band the local average brightness value in the predetermined localregion, which is the result of the calculation at the local averagebrightness calculating section 2 (image conversion: step S3).

Subsequently described is a case in which a gradation conversion isused, as the image conversion process (correcting process) at the imageconversion processing section 7, by employing a mapping curve,illustrated in FIG. 4, in which a local contrast emphasis and a skintexture and a color correction are both achieved.

In FIG. 4, reference symbol 701 denotes the local brightness averagelevel. Reference symbol 702 denotes an input brightness level. Referencesymbols 703 and 704 denote an output brightness level. Reference symbol711 denotes a skin-region mapping curve. Reference symbol 712 is anon-skin-region mapping curve.

The image conversion processing section 7 continuously changes themapping curve by using the correction amount parameter b that isoutputted from the correction amount (effect) calculating section 6 andthat is continuously changed. Then, the brightness signal (Y) outputtedfrom the brightness signal delay section 8 is converted in accordancewith the mapping curve. Thus, the contrast correction is executed at thelocal region. It is to be noted that the brightness signal (Y) after thecorrection is outputted from the image processing apparatus 1.

In the image process in which the correction effect is performed to theinputted brightness signal, the correction for suppressing the gradationchange is executed, as the correction parameter b is high (or as thelocal region is determined to be the skin region). On the other hand,the correction for increasing the gradation change is executed, as thecorrection parameter b is low (as the local region is determined to bethe non-skin region).

A contrast correction in the predetermined local region may be employedas the image process (image correction). The contrast in thepredetermined local region is decreased, as the correction parameter bis high (as the local region is determined to be the skin region). Onthe other hand, the contrast in the predetermined local region isincreased, as the correction parameter b is low (as the local region isdetermined to be the non-skin region).

In other words, the above-mentioned case is as described below.Specifically, when the correction parameter b outputted from thecorrection amount (effect) calculating section 6 is high (when the skincolor level is high) (i.e., when the local region is determined to bethe skin region), the skin-region mapping curve 711 is used. With this,the local histogram 751 before the correction in FIG. 5 may have thereduced dynamic range of the gradation (the contrast is reduced) as thehistogram 753 after the correction of the skin region shown in FIG. 6.Since the contrast is reduced (the local contrast is lowered) asdescribed above, spots, wrinkles, breakouts, or the like on a human skincan be made unnoticeable. In other words, it makes a human skin in animage look fine, thereby being capable of making the skin look nice(this correction is referred to as a skin texture and color correction).

On the other hand, when the correction parameter b outputted from thecorrection amount (effect) calculating section 6 is low (when the skincolor level is low) (i.e., when the local region is determined to be thenon-skin region), the non-skin-region mapping curve 712 is used. Withthis, the local histogram 752 before the correction in FIG. 5 may havethe increased dynamic range of the gradation (the contrast is increased)as the histogram 754 after the correction of the non-skin region shownin FIG. 6. Since the contrast is increased (the local contrast isincreased) as described above, the region other than the human skin iscaused to look with increased clearness.

As understood from the above, the correcting process at the imageconversion processing section 7 is performed such that the correctioneffect for the local region is changed between a case in which the localregion is determined to be the skin region and a case in which the localregion is determined to be the non-skin region. Here, the change in thecorrection effect is continuous with respect to the change in the localskin color level and the change in the local brightness deviation.Further, the change in the correction effect is continuous with respectto the change in the local skin color level and the change in thedirectional high-frequency component.

Moreover, the image processes described above are locally performed.Accordingly, the image processes that are different from each other canadaptively be performed for every region even in one screen.

The example of the local contrast emphasis and the skin texture andcolor correction has been described above, but a coefficient of a filtermay be continuously changed. In this case, the coefficient of the filteris changed between LPF and HPF. With this, when the skin level in thelocal region is high, it is set to LPF so as to blur the irregularity onthe skin or reduce noise. On the other hand, when the skin level on thelocal region is low, it is set to HPF so as to emphasize an edge.

As described above, according to the image processing apparatus 1 of thepresent embodiment, the skin region is detected by using not only thelocal skin color level in the local region but also the local brightnessdeviation (brightness dynamic range) in the local region. Accordingly,the erroneous determination upon detecting the skin region can bereduced.

The brightness change is sharper in an image in the vicinity of eye oreyelash than in a skin image. Therefore, when the skin region isdetected by also using the local brightness deviation (brightnessdynamic range) in the local region, the portion around the eye can beexcluded from the skin region, whereby an effect of preventing theerroneous application of a skin texture and color correction to eyes oreyelashes is provided. Consequently, it can be prevented that the skintexture and color correction is performed to the eyes or eyelashes,thereby being capable of preventing the whole image from having ablurred impression.

The image processing apparatus 1 according to the present embodimentemploys the difference between the maximum brightness value and theminimum brightness value in the local region as the local brightnessdeviation. Accordingly, the local brightness deviation can be obtainedwith a simple calculation. Consequently, the circuit scale or theprogram-processing amount can be reduced, whereby the production costcan be reduced, and the processing speed can be increased. Further,since the difference between the maximum brightness value and theminimum brightness value is used, it can be determined with highprecision whether only a skin is included or an eye or eyelash is alsoincluded. Therefore, the skin texture and color correction to the eye oreyelash can be suppressed upon the correction.

Moreover, the image processing apparatus 1 according to the presentembodiment uses, as the local region, one or a plurality of blocks thatare obtained by dividing a screen (image) into a plurality of blocks.Therefore, it is unnecessary to perform the calculation of thesurrounding for every one pixel, so that the calculation in a block unitmay suffice. Accordingly, the local brightness deviation can be obtainedwhile reducing the amount of the calculation. As a result, the circuitscale or the program-processing amount can be reduced, whereby theproduction cost can be reduced, and the processing speed can beincreased,

Furthermore, the image processing apparatus 1 according to the presentembodiment uses the brightness value that is averaged beforehand in aregion, which is smaller than the predetermined local region, in thepredetermined local region when the local brightness deviation isobtained (in particular, when the maximum brightness value and theminimum brightness value in the region having a predetermined size areobtained). Therefore, the erroneous determination of the skin region dueto the noise can be suppressed.

Moreover, the image processing apparatus 1 can detect the skin region byusing not only the local skin color level but also the directionalhigh-frequency component in the local region. In the case of theconfiguration described above, there is provided an effect of reducingthe erroneous determination upon detecting the skin region.

The spatial frequency of a human hair is low in the direction in whichhair grows, while it is high in the direction crossing the direction inwhich hair grows. Therefore, hairs or the like can particularly beexcluded from the skin region by the detection of the skin region withthe use of the directional high-frequency component, whereby theerroneous application of the skin texture and color correction to thehairs or the like can be prevented. Accordingly, it can be preventedthat the impression of hairs being planar in an image is given.

The image processing apparatus 1 according to the present embodimentuses the equation (1) as the directional high-frequency component h.Therefore, the directional high-frequency component h can be obtainedwith reduced calculation amount. As a result, the circuit scale or theprogram-processing amount can be reduced, whereby the production costcan be reduced, and the processing speed can be increased.

It is supposed that the change in the correction-amount parameter boutputted from the correction amount (effect) calculating section 6 isdiscontinuous with respect to the change in the inputted brightnessvalue or the respective color-difference values. In this case, there maybe a case in which the brightness becomes greatly discontinuous duringthe gradation correction using the aforesaid mapping curve. Therefore,the problem in which the visual level difference is particularlyincreased more than the edge emphasis might arise.

In view of this, in the image processing apparatus 1 according to thepresent embodiment, the change in the correction-amount parameter boutputted from the correction amount (effect) calculating section 6 andthe change in the mapping curve become continuous with respect to thechange in the inputted brightness value or the respectivecolor-difference values. Accordingly, the present embodiment provides aneffect of reducing the level difference, which is caused by a sharpchange in the correction amount or the correcting effect, at thegradation section or the like,

When the local region is determined to the skin region, the imageprocessing apparatus 1 according to the present embodiment executes acorrection for suppressing the gradation dynamic range. Since thecontrast is reduced (since the local contrast is reduced) with this,spots, wrinkles, breakouts, or the like on a human skin can be madeunnoticeable. In other words, it makes a human skin in an image lookfine, thereby being capable of making the skin look nice.

When the local region is determined to be the non-skin region, the imageprocessing apparatus 1 according to the present embodiment executes acorrection for increasing the gradation dynamic range. Since thecontrast is increased (since the local contrast is increased) with this,the region other than the human skin is clearly visualized withincreased unambiguity.

The present invention is applicable for the image process for the edgeemphasis, for improving the local contrast, or for making a human skinlook fine, which process is carried out before a digital image taken byan imaging apparatus is displayed, stored, and transmitted.

In the gradation correcting process in which the brightness correctionamount is determined in local region based on the local averagebrightness so as to correct the brightness value based on the correctionamount, it is particularly demanded that the continuity of the gradationat the gradation portion where the gradation is continuous is maintainedeven after the gradation correction.

For example, when a human face is detected by using a face recognitiontechnique such as a pattern matching, and the gradation correction isperformed only to the region of the detected human face with the othermethod, there may be a case in which the portion where the gradationbecomes discontinuous is produced at the boundary between the regiondetected as the face and the other region.

Since the skin level that is an index of the skin region similarity iscontinuously changed in the present invention, smoothness of skin can bekept in the gradation region of a human skin even after the correctionby applying the present invention to the gradation correcting process,whereby a significant effect can particularly be obtained. Thedifference at the boundary between a face and a portion other than theface is remarkable in particular.

A program including the respective steps including the flowchartillustrated in FIG. 3 may be recorded onto a computer-readable recordingmedium.

More specifically, a program may be recorded onto a computer-readableprogram, the program including a step of calculating, as a local skincolor level, a skin color level at a predetermined local region in animage; a step of calculating, as a local brightness deviation, abrightness dynamic range at the predetermined local region; and a stepof detecting whether the predetermined local region is a skin region ornot by using the local skin color level and the local brightnessdeviation.

Further, a program may be recorded onto a computer-readable program, theprogram including a step of calculating, as a local skin color level, askin color level at a predetermined local region in an image; a step ofcalculating a directional high-frequency component, which is an indexindicating a magnitude of a first brightness amplitude change to anamount of a second brightness amplitude change, when the firstbrightness amplitude change occurs in a first direction in the localregion, and the second brightness amplitude change, which is smallerthan the first brightness amplitude change, occurs in a seconddirection, which is generally orthogonal to the first direction; and astep of detecting whether the predetermined local region is a skinregion or not by using the local skin color level and the directionalhigh-frequency component.

Since the program stored onto the program recording mediums describedabove is read and executed by a computer, the operation same as that ofthe apparatus illustrated in FIG. 1 can be made.

The present invention has been described above in detail. The aforesaiddescription is only illustrative in all aspects, and the presentinvention is not limited thereto. It is construed that enormousmodifications not illustrated can be assumed without departing from thescope of the invention.

1-19. (canceled)
 20. An image processing apparatus comprising: a localskin color level calculating section for calculating, as a local skincolor level, a skin color level at a predetermined local region in animage; a local brightness deviation calculating section for calculating,as a local brightness deviation, a brightness dynamic range at thepredetermined local region; and a skin region detecting section fordetecting whether the predetermined local region is a skin region or notby using the local skin color level and the local brightness deviation.21. The image processing apparatus according to claim 20, furthercomprising: an image conversion processing section that corrects theimage based on the local skin color level and the local brightnessdeviation, wherein the image conversion processing section corrects theimage continuously with respect to the change in the local skin colorlevel and the change in the local brightness deviation.
 22. The imageprocessing apparatus according to claim 21, wherein the skin regiondetecting section detects, as the skin region, a region where the localskin color level is higher than a first threshold value and the localbrightness deviation is smaller than a second threshold value.
 23. Theimage processing apparatus according to claim 21, wherein thepredetermined local region includes a plurality of pixels, the localbrightness deviation calculating section calculates the brightness valuefor every pixel included in the predetermined local region and canobtain the maximum brightness value and the minimum brightness value asa result of the calculation, and the local brightness deviation is thedifference between the maximum brightness value and the minimumbrightness value.
 24. The image processing apparatus according to claim23, wherein the local brightness deviation calculating section obtainsthe local brightness deviation in a unit of a block obtained by dividingthe image into a plurality of blocks.
 25. The image processing apparatusaccording to claim 23, wherein the local brightness deviationcalculating section uses an average brightness value, which iscalculated beforehand in the predetermined local region with respect toa small region having a pixel size smaller than that in thepredetermined local region, when the local brightness deviation iscalculated.
 26. The image processing apparatus according to claim 21,wherein the image conversion processing section executes a correctionfor suppressing the gradation change in the predetermined local region,when the predetermined local region is determined to be the skin region.27. The image processing apparatus according to claim 21, wherein theimage conversion processing section executes a correction for increasingthe gradation change in the predetermined local region, when thepredetermined local region is determined not to be the skin region. 28.The image processing apparatus according to claim 21, wherein the imageconversion processing section executes a contrast correction to theinputted brightness signal in the predetermined local region.
 29. Theimage processing apparatus according to claim 28, wherein the imageconversion processing section decreases the contrast in thepredetermined local region when the predetermined local region isdetermined to be the skin region.
 30. The image processing apparatusaccording to claim 28, wherein the image conversion processing sectionincreases the contrast in the predetermined local region when thepredetermined local region is determined not to be the skin region. 31.The image processing apparatus according to claim 21, furthercomprising: a local average brightness calculating section thatcalculates the local average brightness in the predetermined localregion, wherein the image conversion processing section corrects theimage by using the local average brightness.
 32. An image processingapparatus comprising: a local skin color level calculating section forcalculating, as a local skin color level, a skin color level at apredetermined local region in an image; a local brightness highfrequency calculating section that, when a first brightness amplitudechange occurs in a first direction in the predetermined local region,and a second brightness amplitude change, which is smaller than thefirst brightness amplitude change, occurs in a second direction, whichis generally orthogonal to the first direction, calculates a directionalhigh-frequency component, which is an index indicating a magnitude ofthe first brightness amplitude change to the amount of second brightnessamplitude change; and a skin region detecting section for detectingwhether the predetermined local region is a skin region or not by usingthe local skin color level and the directional high-frequency component.33. The image processing apparatus according to claim 32, furthercomprising: an image conversion processing section that corrects theimage based on the local skin color level and the directionalhigh-frequency component, wherein the image conversion processingsection corrects the image continuously with respect to the change inthe local skin color level and the change in the directionalhigh-frequency component.
 34. The image processing apparatus accordingto claim 33, wherein the skin region detecting section detects, as theskin region, a region where the local skin color level is higher than afirst threshold value and the directional high-frequency component issmaller than a second threshold value.
 35. The image processingapparatus according to claim 33, wherein the directional high-frequencycomponent is the |first brightness amplitude change amount|−|the secondbrightness amplitude change amount|.
 36. The image processing apparatusaccording to claim 35, wherein when the brightness value Yij (0≦i≦2,0≦j≦2) of each pixel included in a region of 3-pixel×3-pixel is used,the directional high-frequency component is expressed byh=max(||Y11−(Y01+Y21)/2|−|Y11−(Y10+Y12)/2||,||Y11−(Y00+Y22)/2|−|Y11−(Y02+Y20)/2||)  (1)
 37. The image processingapparatus according to claim 33, wherein the image conversion processingsection executes a correction for suppressing the gradation change inthe predetermined local region, when the predetermined local region isdetermined to be the skin region.
 38. The image processing apparatusaccording to claim 33, wherein the image conversion processing sectionexecutes a correction for increasing the gradation change in thepredetermined local region, when the predetermined local region isdetermined not to be the skin region.
 39. The image processing apparatusaccording to claim 33, wherein the image conversion processing sectionexecutes a contrast correction to the inputted brightness signal in thepredetermined local region.
 40. The image processing apparatus accordingto claim 39, wherein the image conversion processing section decreasesthe contrast in the predetermined local region when the predeterminedlocal region is determined to be the skin region.
 41. The imageprocessing apparatus according to claim 39, wherein the image conversionprocessing section increases the contrast in the predetermined localregion when the predetermined local region is determined not to be theskin region.
 42. The image processing apparatus according to claim 33,further comprising: a local average brightness calculating section thatcalculates the local average brightness in the predetermined localregion, wherein the image conversion processing section corrects theimage by using the local average brightness.
 43. A program recordingmedium that records a program onto a computer-readable recording medium,the program including: a step of calculating, as a local skin colorlevel, a skin color level at a predetermined local region in an image; astep of calculating a brightness dynamic range at the predeterminedlocal region as a local brightness deviation; and a step of detectingwhether the predetermined local region is a skin region or not by usingthe local skin color level and the local brightness deviation.
 44. Aprogram recording medium that records a program onto a computer-readablerecording medium, the program including: a step of calculating, as alocal skin color level, a skin color level at a predetermined localregion in an image; a step of calculating a directional high-frequencycomponent, which is an index indicating a magnitude of an amount of afirst brightness amplitude change to an amount of a second brightnessamplitude change, when the first brightness amplitude change occurs in afirst direction in the predetermined local region, and the secondbrightness amplitude change, which is smaller than the first brightnessamplitude change, occurs in a second direction, which is generallyorthogonal to the first direction; and a step of detecting whether thepredetermined local region is a skin region or not by using the localskin color level and the directional high-frequency component.